package com.example.administrator.chenencryption;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;

public class Base64activity extends AppCompatActivity {
private String data="望长城内外惟余莽莽";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_base64activity);
        byte[] encode = Base64.encode(data.getBytes(), Base64.DEFAULT);

        String str="5L2g5aW9";
        byte[] decode = Base64.decode(str.getBytes(), Base64.DEFAULT);

        Log.d("flag", "--------使用base64解码的内容---onCreate: "+new String(decode));

    }
}
